package com.zhuchaooasystem.widget;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.zhuchaooasystem.R;


/**
 * @author yinsi
 */
public class DownloadDialog extends AlertDialog {

    private TextView txt_title;
    private ProgressBar progressBar;
    private TextView txt_progress;

    public DownloadDialog(Context context) {
        super(context);
    }

    protected DownloadDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    public DownloadDialog(Context context, int themeResId) {
        super(context, themeResId);
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            setContentView(R.layout.dlg_download);
            //----
            txt_title = (TextView) findViewById(R.id.dialog_download_tv_title);
            progressBar = (ProgressBar) findViewById(R.id.dialog_download_progressBar);
            txt_progress = (TextView) findViewById(R.id.dialog_download_txt_progress);
        } catch (Exception e) {
        }
    }

    public void setTextTitle(String title) {
        if (null != txt_title) {
            txt_title.setText(title);
        }
    }

    public TextView getTxt_progress() {
        return txt_progress;
    }

    public void setTxt_progress(TextView txt_progress) {
        this.txt_progress = txt_progress;
    }

    public ProgressBar getProgressBar() {
        return progressBar;
    }

    public void setProgressBar(ProgressBar progressBar) {
        this.progressBar = progressBar;
    }
}
